using System;
using System.Runtime.InteropServices;
using FluentTests.Framework.Verbs;

namespace FluentTests.Framework.VerbExtensions
{
    public static class VerbInt32Extensions  
    {
        public static void GreaterThan(this Is<int> verb, int compareValue)
        {
            var assertion = verb.EnsuredWrapperObject.AssertionProvider;
            var actualValue = verb.EnsuredWrapperObject.ActualValue;
            NumberAssertion.GreaterThan(actualValue, compareValue, verb.Negated, assertion);
        }

        public static void LessThan(this Is<int> verb, int compareValue)
        {
            var assertion = verb.EnsuredWrapperObject.AssertionProvider;
            var actualValue = verb.EnsuredWrapperObject.ActualValue;
            NumberAssertion.LessThan(actualValue, compareValue, verb.Negated, assertion);
        }

        public static void EqualTo(this Is<int> verb, int compareValue,[Optional, DefaultParameterValue(null)] string message)
        {
            VerbAssert<int>.Assert(
                verb,
                a => a != compareValue,
                message ?? "Actual value is {not} equal to expected value");
        }


        public static void Zero(this Is<int> verb)
        {
            var assertion = verb.EnsuredWrapperObject.AssertionProvider;
            var actualValue = verb.EnsuredWrapperObject.ActualValue;
            NumberAssertion.Zero(actualValue, verb.Negated, assertion);
        }

    }
}